function smoothed=smooth( lum )
% smooths luminance map. input is matrix of [0,1) values, output is the
% same, but smoothed

sm = [ 0.1 0.2 0.1 ; 0.2 0.5 0.2; 0.1 0.2 0.1 ];

smsum = sum(sum( sm));

smoothed = conv2( lum, sm) / smsum;